home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / circle.doc < prev    next >
Text File  |  1995-03-31  |  5KB  |  123 lines

  1. (Comp.sys.handhelds) 
  2. Item: 3389 by CW%APG.PH.UCL.AC.UK at CUNYVM.CUNY.EDU 
  3. Author: [Conrad Winchester] 
  4.   Subj: ML Circles 
  5.   Date: Thu Jun 06 1991 
  6.  
  7. [Thanx, Conrad, not only for your useful CIRCLE code, but also for this 
  8.  delightful parody of those ubiquitous "disclaimers".  -jkh-] 
  9.  
  10.  
  11. Lightning strikes, the ESD readings flicker momentarily, and a solitary dark 
  12. cowelled figure is silouetted against the dungeon wall.  He seems to be leaning 
  13. over a small oblong object that you would estimate to be about 7'x3'x1' in 
  14. size.  With a blood curdling shriek he falls to the ground and seems to melt 
  15. away into nothingnessnous leaving behind only his cowel and ...  and ...  a 
  16. piece of paper lying on the floor by the cowel.  You assume he must have been 
  17. holding it in his hand afore his dreaded fate.  Moving forward carefully, you 
  18. pick up the piece of paper, and upon examination you find it to be an 
  19. incantation of sorts.  You read on, terror emptying into your heart with every 
  20. word ... 
  21.  
  22.          
  23.          
  24.         "The following is a machine code routine to draw Circles quite 
  25.         quickly on the present PICT GROB.  The GROB can be any size as 
  26.         the routine reads the size of the GROB itself.  It is fairly 
  27.         robust - All plotting is kept within the GROB area.  If PICT 
  28.         does not exist then it creates the default 131x64 PICT.  It does 
  29.         some very rudimentry argument checking.  (If anybody could send 
  30.         a quick tutorial on checking arguments in system RPL to C.S.H I 
  31.         would be very grateful!).  All in all it should work well, but 
  32.         if you have any problems let me know.  When stored in the 
  33.         variable 'CIRCLE' it has the checksum #77c7h and takes up 305 
  34.         bytes.  It takes as arguments 
  35.  
  36.                           2:        { #x  #y } 
  37.                           1:                r 
  38.  
  39.         where { #x #y } is the pixel coordinate of the centre of the 
  40.         circle (#x,#y are binary integers), and r is a real number 
  41.         representing the radius of the circle in pixels.  Also included 
  42.         are two demonstration routines to give you a taste of what's 
  43.         possible.  The ->ASC encoded version of 'CIRCLE' follows: 
  44.  
  45. %%HP: T(1)A(D)F(.); 
  46. "D9D20AEC81322302351566115CCD20A22008FD5F3081AF0B81AF028F1466081A 
  47. F048FB9760D281AF0881AF1C8AE606F90C6FA818F2281AF097D9081AF1980824 
  48. FFFF78B6E1818F2581AF10C4C4C281AF09613081AF1CCE81AF0C81AF10EAC4C4 
  49. 818F0581AF19C281AF0981AF10E481AF0081AF1C8B2688A6607C108D34150D78 
  50. 1AF13D876A08D341507F50C3C873907350C3E877807560C3C87B707950C3E87F 
  51. 607F20E3C873607320E3E877507530E3C87B407920E3E87F3050081AF1BD581A 
  52. F1AD781AF1C81AF100181AF1BD581AF1AD781AF1881AF14011B5650714613416 
  53. E142D606CCDB8B257184146CED48B66616913207819F2819F2819F2E6C6CD480 
  54. CA68FFDBD5D680824300000EF4E58B0A0FCC50EF4819F3819F3CB1371430EF81 
  55. 41010701B21307C77" 
  56.  
  57.         The two demonstration routines follow: 
  58.  
  59.         DEMO1 is: 
  60.  
  61. %%HP: T(3)A(D)F(.);   @  [called CIRCDMO1 on this disk  -jkh-] 
  62. \<< 
  63.     # 150d # 150d 
  64.       PDIM 
  65.       { # 0d # 0d } PVIEW 
  66.       0 149 FOR i 
  67.         i R\->B 75 R\->B 2 \->LIST i 75 - ABS CIRCLE 
  68.       3 STEP 
  69. \>> 
  70.  
  71.         DEMO2 is: 
  72.  
  73. %%HP: T(3)A(D)F(.);   @  [called CIRCDMO2 on this disk  -jkh] 
  74. \<< 
  75.    { # 0d # 0d } PVIEW 
  76.    10 130 FOR i 
  77.      10 64 FOR j 
  78.        i R\->B j R\->B 2 \->LIST 10 CIRCLE 
  79.      10 STEP 
  80.    10 STEP 
  81. \>> 
  82.  
  83.         I hope this is clear and that some people find this useful. 
  84.         Please let me know your thoughts on how this routine could be 
  85.         improved.  I for one am going to try and make it even faster!!! 
  86.         That's all for now except for the disclaimer: 
  87.  
  88.         I accept no responsibility for anything done by this program 
  89.         constructive or destructive, but be warned, never ever on any 
  90.         account use this program in a damp dungeon where water may drop 
  91.         on your calculator and cause serious electric shock, or worse 
  92.         still, damage it. 
  93.  
  94.                           YOU HAVE BEEN WARNED!" 
  95.  
  96.          
  97.          
  98. You notice the paper is rather grusomely charred, and there is the smell of 
  99. ozone in the air.  A thought enters your mind: 
  100.  
  101. "I can't afford an HP48, and this bloke certainly won't be needing his 
  102. anymore!" 
  103.  
  104. You turn and pick it up... 
  105.  
  106.          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGH  ZAP SPLAT" 
  107.  
  108. As your body melts around you, you see the screen of the calculator and you 
  109. notice with horror your death was in vain for on the screen are the words: 
  110.  
  111.  
  112.                "GATEWAY 
  113.  
  114.  
  115.                      ENTER CODE" 
  116.  
  117.  
  118.  
  119.                       :-) 
  120.  
  121.  
  122.             Conrad 
  123.